import random
from typing import *


class Solution:
    def maxIncreasingSubarrays(self, nums: List[int]) -> int:
        n = len(nums)
        dp = [1] * n
        for i in range(n - 2, -1, -1):
            if nums[i] < nums[i + 1]:
                dp[i] = dp[i + 1] + 1
        dpi = 1
        ans = 0
        for i in range(n - 1):
            if i > 0 and nums[i] > nums[i - 1]:
                dpi += 1
            else:
                dpi = 1
            ans = max(ans, min(dpi, dp[i + 1]))
        return ans


cases = [[2, 5, 7, 8, 9, 2, 3, 4, 3, 1], [1, 2, 3, 4, 4, 4, 4, 5, 6, 7]]
a = []
for i in range(100):
    a.append(random.randint(0, 20))
    # a.append(random.randint(-(10**9), 10**9))
cases.append(a)
print(a)
so = Solution()
for c in cases:
    print(so.maxIncreasingSubarrays(c))
